package ovm.gui.selectors;

import com.vaadin.ui.ComboBox;
import ovm.management.AbstractManager;

import java.util.List;

public class AbstractEntitySelector extends ComboBox {

    public AbstractEntitySelector (Class entityClass) {
        super();
        setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ID);
        //setNullSelectionAllowed(false);
        List entityList = AbstractManager.getEntityListByClass(entityClass);
        for (Object entity : entityList) {
            addItem(entity);
        }
        setTextInputAllowed(false);
    }

}
